<template lang="">
  <div id='app'>
    <!-- 返回顶部按钮 -->
    <back-top></back-top>

    <!-- 视图 -->
    <router-view></router-view>

  </div>
</template>
<script>
    import jQuery from 'jquery'
    //导入返回顶部按钮
    import BackTop from '@/components/backTop/BackTop.vue'
    export default {
        components: {
            BackTop
        },
        created() {
            setTimeout(() => {
                // 加载页面完后移除加载动画
                document.body.removeChild(document.getElementById('Loading'))
            }, 1000)
            var a_idx = 0;
            jQuery(document).ready(function($) {
                $("body").click(function(e) {
                    var a = new Array("❤Javascript第一❤", "❤不做咸鱼！❤", "❤拒绝懒惰！❤", "❤爱你哦❤", "❤想做吃货❤", "❤向大佬学习❤", "❤扶我起来~❤", "❤come on❤", "❤一直在路上~❤", "❤累了~❤", "❤再趴一会❤", "❤66666❤", "❤高兴的飞起*****❤");
                    var $i = $("<span></span>").text(a[a_idx]);
                    a_idx = (a_idx + 1) % a.length;
                    var x = e.pageX,
                        y = e.pageY;
                    $i.css({
                        "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
                        "top": y - 20,
                        "left": x,
                        "position": "absolute",
                        "font-weight": "bold",
                        "color": "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
                    });
                    $("body").append($i);
                    $i.animate({
                            "top": y - 180,
                            "opacity": 0
                        },
                        1500,
                        function() {
                            $i.remove();
                        });
                });
            });
        },

    }
</script>
<style lang="less">
    #app {
        width: 100%;
        height: 100%;
    }
</style>